package day14.KeJian;

public class MyRunnable02 implements Runnable{
    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            try {
                Thread.sleep(300);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println(Thread.currentThread().getName()+"..."+i);
        }
    }
}
class Demo01{
    public static void main(String[] args) throws InterruptedException {
        //System.out.println("睡觉前");
         //   Thread.sleep(3000);
        //System.out.println("睡醒了");
        MyRunnable02 my = new MyRunnable02();
        Thread t1 = new Thread(my);
        Thread t2 = new Thread(my);

        t1.start();
        t2.start();
    }
}